

#import "ViewController.h"
//导入头文件
#import "Person.h"
@interface ViewController ()
@end
@implementation ViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
    //创建一个类对象
    Person *xiaoMing = [[Person alloc] init];
    
//1.属性set&get方法
    xiaoMing.name = @"小明";
    NSLog(@"name == %@",xiaoMing.name);
    
//2.kvc赋值 暴露在外面的接口(@p属性声明)（常用）
    [xiaoMing setValue:@"小刚" forKey:@"name"];
    NSString *name = [xiaoMing valueForKey:@"name"];
    NSLog(@"name == %@",name);
    
//3.kvc赋值没有接口（成员变量声明）
    [xiaoMing setValue:@"18" forKey:@"age"];
    NSString *age = [xiaoMing valueForKey:@"age"];
    NSLog(@"age == %@",age);
}

@end
